#!/bin/sh -eu
# shellcheck disable=SC1091
[ -e /lxc-ci/etc/config ] && . /lxc-ci/etc/config

UNITS_PATH="/lib/systemd/system"
if [ ! -e "${UNITS_PATH}" ] && [ -e "/usr/lib/systemd/system" ]; then
    UNITS_PATH="/usr/lib/systemd/system"
fi

for file in *.service *.timer; do
  cp -f "$file" "${UNITS_PATH}/"
  systemctl daemon-reload
  systemctl -q reenable "${file}"
done
